<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/_template.xhtml">
	<ui:define name="head">

		<div id="titulo" style="background: #EFF3FA; height: 24px; width: 95%"
			align="left">
			<h:outputText value="Usuário > Lista de Usuários" styleClass="title"
				style="line-height: 20px;" />
			<div style="background: #C4D2EB; height: 2px;"></div>
		</div>

	</ui:define>

	<ui:define name="body">

		<div class="Centralizar" style="background: white;">

			<!-- 		Acesso não permitido -->
			<h:form rendered="#{loginBean.usuario.perfil.id==4}">
				<div align="center">

					<br />
					<p:graphicImage value="/resources/img/noacsses.png" />
					<br />
					<br />
					<br />
					<br /> <a href="javascript:history.back(-1)">Voltar</a><br />


				</div>
			</h:form>

			<!-- 			Apenas para acesso administrador		 -->
			<h:form id="form_acesso1"
				rendered="#{loginBean.usuario.perfil.id!=4}">

				<fieldset
					style="border: 1px solid #6A6A6A; border-top: white; border-left: white; border-bottom: white; border-right: white;">

					<div
						style="background: #394674; align-top: center; height: 20px; line-height: 20px;"
						align="center">
						<h:outputText value="USUÁRIOS DO SISTEMA"
							style="color: white; font-size: 12px;" styleClass="OutPut" />
					</div>

					<p:dataGrid var="usuario" value="#{usuarioBean.ativados}"
						columns="3" rows="12" paginator="true" paginatorPosition="bottom"
						emptyMessage="">

						<p:panel header="#{usuario.nome}" style="text-align:center">
							<h:panelGrid columns="1" style="width:100%">

								<h:outputText value="Email: #{usuario.login}" />

								<h:outputText value="CPF: #{usuario.cpf}"
									rendered="#{loginBean.usuario.perfil.id==1 or loginBean.usuario.perfil.id ==2}" />

								<h:outputText value="Perfil: #{usuario.perfil.perfil}" />

								<h:outputText value="Nascimento" />
								<h:outputText value="#{usuario.nascimento}">
									<f:convertDateTime timeZone="America/Sao_Paulo" locale="pt_BR" />
								</h:outputText>

							</h:panelGrid>
						</p:panel>

					</p:dataGrid>

				</fieldset>

				<div align="left" style="width: 350px; margin-right: 500px;">
					<p:messages autoUpdate="true" />
				</div>

			</h:form>

			<p:dialog rendered="#{loginBean.usuario.id==null}" visible="true"
				resizable="false" closable="false" modal="true">
				<div align="center">

					<br />
					<p:graphicImage value="/resources/img/noacsses.png" />
					<br /> <br /> <br /> <br /> <a
						href="javascript:history.back(-1)">Voltar</a><br />

				</div>
			</p:dialog>

			<!-- 			restrição de acesso para ususario status == false -->
			<p:dialog rendered="#{loginBean.usuario.esqueciSenha!=false}"
				visible="true" resizable="false" closable="false" modal="true">
				<div align="center">

					<br />
					<p:graphicImage value="/resources/img/noacsses.png" />
					<br /> <br /> <br /> <br /> <a
						href="javascript:history.back(-1)">Voltar</a><br />

				</div>
			</p:dialog>
		</div>
	</ui:define>

</ui:composition>
</html>